package com.chushouya.controller.product.api;


import com.chushouya.common.annotations.AuthSkip;
import com.chushouya.common.constant.ServiceType;
import com.general.framework.core.schema.Response;
import com.chushouya.product.dto.api.category.CategoryApiDTO;
import com.chushouya.product.service.api.CategoryApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
@Api(tags =  ServiceType.API +"分类接口")
@RestController
@RequestMapping( ServiceType.API +"/category")
@Slf4j
public class CategoryApiController {

    @Resource
    private CategoryApiService categoryService;

    @ApiOperation("获取产品分类列表接口")
    @GetMapping("/list")
    @AuthSkip
    public Response<List<CategoryApiDTO>> list() {
        return Response.success(categoryService.categoryList());
    }
}
